#include <stdio.h>
#include <string.h>

void printWords(char str[], int m , int n )
{
	for(int i = m; i <= n; i++){
		printf("%c", str[i]);
	}
	printf("%c", m == 0?'\n':' ');
}

int main()
{
	char str[1024] = {0};
	int size = 0;
	printf("请输入一句英文: \n");
	while(1){
		char c = getchar();
		if(c  == '\n'){
			break;
		}
		str[size++] = c;
	}
	int m = 0, n = size - 1;
	for(int i = size - 1; i >= 0; i--){
		if(str[i] == ' '){
			m = i + 1;
			printWords(str, m, n);
			n = m - 2;
		}
	}
	printWords(str, 0, n);
	return 0;
}
